//
//  HROrderApplyHeader.m
//  haierapp
//
//  Created by gaotangzhang on 14-8-19.
//  Copyright (c) 2014年 haier. All rights reserved.
//

#import "HROrderApplyHeader.h"

@implementation HROrderApplyHeader

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code
    }
    return self;
}

-(id)initWithType:(APPLY_HEADER)type showTopLine:(BOOL)showTopLine{
    
    self=[[[NSBundle mainBundle]loadNibNamed:@"HROrderApplyHeader" owner:self options:nil]objectAtIndex:0];
    
    self.titleLabel.hidden=YES;
    self.descLabel.hidden=YES;
    self.imageView.hidden=YES;
    
    if (type==APPLY_HEADER_TITLE) {
        self.titleLabel.hidden=NO;
        
        [self.imageView removeFromSuperview];
    }else if(type==APPLY_HEADER_TITLE_IMAGE){
        self.titleLabel.hidden=NO;
        self.imageView.hidden=NO;
    }else if (type==APPLY_HEADER_TITLE_DESC){
        self.titleLabel.hidden=NO;
        self.descLabel.hidden=NO;
        [self.imageView removeFromSuperview];
    }else{
        self.titleLabel.hidden=NO;
        self.descLabel.hidden=NO;
        self.imageView.hidden=NO;
    }
    
    if (showTopLine) {
        self.topLine.hidden=NO;
    }else{
        self.topLine.hidden=YES;
    }
    
    
    
    return self;
    
}



/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
    // Drawing code
}
*/

@end
